import { get, del, post } from './http'
const API_PROXY_PREFIX = '/api'
export const BASE_URL =
  (process.env.NODE_ENV === 'production' ? import.meta.env.VITE_APP_API_BASE_URL : API_PROXY_PREFIX) + '/api'

export const getDesignModelContent = (data?: object) => {
  console.log('======', process.env.NODE_ENV, import.meta.env)
  return post(BASE_URL + '/base/content/getBySid', data)
}
export const contentModify = (data?: object) => {
  return post(BASE_URL + '/base/content/modify', data)
}
export const contentAdd = (data?: object) => {
  return post(BASE_URL + '/base/content/add', data)
}
//
export const projectAdd = (data?: object) => {
  return post(BASE_URL + '/base/bigScreen/add', data)
}
export const projectModify = (data?: object) => {
  return post(BASE_URL + '/base/bigScreen/modify', data)
}
export const projectDelete = (data?: object) => {
  return post(BASE_URL + '/base/bigScreen/delete', data)
}
export const getProject = (data?: object) => {
  return post(BASE_URL + '/base/bigScreen/getBySid', data)
}
export const projectPage = (data?: object) => {
  return post(BASE_URL + '/base/bigScreen/page', data)
}
export const projectQuery = (data?: object) => {
  return post(BASE_URL + '/base/bigScreen/query', data)
}
//

export const login = (data?: object) => {
  return post(BASE_URL + '/base/user/login', data)
}
export const getMyInfo = (data?: object) => {
  return post(BASE_URL + '/base/user/getMyInfo', data)
}
//通用上传
export const upload = (data?: object) => {
  return post(
    BASE_URL + '/base/baseFile/upload',
    data,
    'multipart/form-data; boundary=----WebKitFormBoundary3SPcCvB8h46hBnUa'
  )
}
//图片上传
export const BSupload = (data?: object) => {
  return post(
    BASE_URL + '/base/baseFile/upload',
    data,
    'multipart/form-data; boundary=----WebKitFormBoundary3SPcCvB8h46hBnUa'
  )
}
export const getPhotoList = (data?: object) => {
  return post(BASE_URL + '/base/baseFile/list', data)
}
export const delFile = (data?: object) => {
  return del(BASE_URL + '/base/baseFile', data)
}
